const os = require("os");
const process = require("process");
const util = require("util");
let cwd = process.cwd();
const IS_CLOUDNODE = !!process.env['CLOUDNODE'];

const USERNAME = ($ => {
    try {
        let userInfo = os.userInfo();
        return `[${userInfo.username}@${os.hostname()}@${cwd}]`
    } catch (e) {
        if (IS_CLOUDNODE) {
            return `IS_CLOUDNODE:${cwd}:${process.env.CLOUDNODE}`
        }
        return `(unknown@${cwd}:${util.inspect(e)})`
    }
})();

module.exports = {
    USERNAME:USERNAME
}